package cn.com.tianpeidong.restaurantadmin.project.admin.role.mapper;

import cn.com.tianpeidong.restaurantadmin.project.admin.role.entity.Role;
import cn.com.tianpeidong.restaurantadmin.project.admin.role.entity.RolePermission;
import cn.com.tianpeidong.restaurantadmin.project.admin.role.vo.RoleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author tianpeidong
 * @version 创建时间: 19-4-7 下午9:02
 */
@Mapper
public interface RoleMapper {
    int checkRoleUnderUse(@Param("roleId") Long roleId);

    int delete(@Param("roleId") Long roleId);

    int deleteRolePermission(@Param("roleId") Long roleId);

    Role getById(@Param("id") Long id);

    Role getByName(@Param("roleName") String roleName);

    int insertRolePermission(List<RolePermission> list);

    int update(Role roleInDb);

    int insert(Role newRole);

    List<RoleVO> listRole(RoleVO roleVo);

    List<RoleVO> listAllRoles();
}
